home *** CD-ROM | disk | FTP | other *** search
- /* strset.c From TC Bible page 298 Use strset to set all characters in a
- string excluding the terminating null, to a specific character */
-
- #include <stdio.h>
- #include <string.h>
- #include <conio.h>
-
- main()
- {
- int c;
- char buf[80];
- printf("Enter a string: ");
- gets(buf);
- printf("Enter character you want entier string set to: ");
- c = getche();
- strset(buf, c);
- printf("\nString is now: %s\n", buf);
- }